source(here::here("code/load.R"))

here("data/meta_analyses_raw/BurKosLan2013/Burke_p187_88_table_ocr.xlsx") |>
    read_excel() |>
    mutate(meta_id = "BurKosLan2013",
           subfield = "AP",
           question = "What is the effect of mortality salience on political attitudes and voting behavior?",
           estimate = as.numeric(gsub(" \\(.*", "", effect_size_95_ci)),
           conf.low = as.numeric(gsub(".*\\((.*),.*", "\\1", effect_size_95_ci)),
           conf.high = as.numeric(gsub(".*,(.*)\\).*", "\\1", effect_size_95_ci)),
           study_year = as.numeric(str_extract(study, "\\d{2}")),
           study_year = ifelse(study_year > 80,
                               paste0("19", study_year),
                               paste0("20", str_pad(study_year, width = 2, pad = "0"))),
           study_year = as.numeric(study_year),
           std.error = (conf.high - conf.low) / 3.92) |>
    select(meta_id,
           subfield,
           question,
           study_id = study,
           study_year,
           estimate,
           std.error,
           conf.low,
           conf.high,
           subset = Hypothesis) |>
    write_csv(here("data/meta_analyses_clean/BurKosLan2013.csv"))
